package wkj.yuyanjichu;

import java.util.Scanner;

public class jiuyue11 {
    public static void main(String[] args) {
        int score = 0;
        for (int i=1;i<=10;i++){
            int a = (int)(Math.random()*100);
            int b = (int)(Math.random()*100);
            int result = a+b;
            System.out.println("("+i+")"+a+"+"+b+"=?");
            System.out.println("算吧");
            Scanner scanner = new Scanner(System.in);
            int answer = scanner.nextInt();
            if (answer==-1){
                break;
            }
            if (answer==result){
                System.out.println("√");
                score += 10;
            }else {
                System.out.println("×");
            }
        }
        System.out.println("score:"+score);

        System.out.println("猜吧");
        Scanner scanner = new Scanner(System.in);
        int guess = scanner.nextInt();
        int num = (int)(Math.random()*100+1);
//        while (guess!=num){
//            if (guess>num){
//                System.out.println("猜大了");
//            }else {
//                System.out.println("猜小了");
//            }
//            System.out.println("猜吧");
//            guess = scanner.nextInt();
//        }
//        System.out.println("猜对了");
        do {

            if (guess>num){
                System.out.println("猜大了");
            }else if (guess<num){
                System.out.println("猜小了");
            }else {
                System.out.println("猜对了");
            }
            System.out.println("猜吧");
            guess = scanner.nextInt();
        }while (guess!=num);
        System.out.println("猜对了");

    }
}
